home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: gail.ripco.com!mambuhl
- From: mambuhl@ripco.com (Martin Ambuhl)
- Subject: Re: prototypes
- X-Nntp-Posting-Host: foley.ripco.com
- Message-ID: <DKMnIG.JMI@rci.ripco.com>
- Sender: usenet@rci.ripco.com (Net News Admin)
- Organization: Ripco Internet BBS Chicago
- Date: Wed, 3 Jan 1996 22:51:52 GMT
- X-Ident-Sender: mambuhl
-
- jason_gredley@mindlink.bc.ca (Jason Gredley)
- in <jason_gredley.5.30EA3371@mindlink.bc.ca> writes:
-
- > Formerly I have been programing in C++. Recently however I thought I
- >should at least do a few programs in C, if for nothing else, ability to say
- >that I can program in C. Normally in C++ I would include appropriate header
- >files and then at any point be free to call those functions included in that
- >header file. However when compiling a C program the compiler is generating a
- >zillion _warnings_ of "call to function with no prototype"...
-
- If you are indeed #including the headers, and those headers contain the
- needed prototypes, then your compiler is broken. Show us an example of
- this.
-
- >.... Looking at C
- >example programs, etc it seems customary to identify prototypes at the top of
- >a module as well as including header files (this seems redundant)...
-
- You are looking at bad example programs. It is redundant, since the
- effect of #including the header files is precisely to put the
- information from the header into the source.
-
- >... I am even
- >getting the same warning about calling strcpy (a library function) after
- >including the "string.h" header;...
-
- Again,
- 1) you are not #including <string.h> - or -
- 2) string.h does not contain the needed prototypes - or -
- 3) your compiler is broken.
-
- Since you say that you are including "string.h", if you have a file with
- this name in the search path for user supplied headers, your program
- will never see the system header string.h. There is a difference
- between "string.h" and <string.h>. This is true for C++ also.
-
-
- --
- * Martin Ambuhl net: mambuhl@ripco.com
- * Chicago, IL (USA)
-